Closed Bug 1588185 Opened 6 years ago Closed 5 years ago

When using an old version of clang-format, be more explicit in term of version

Categories

(Developer Infrastructure :: Source Code Analysis, enhancement)

enhancement
Not set
normal

Tracking

(firefox83 fixed)

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: Sylvestre, Assigned: harnaman24, Mentored)

References

(Blocks 2 open bugs)

Details

(Keywords: good-first-bug, Whiteboard: [lang=python])

Attachments

(1 file, 1 obsolete file)

Currently, we have:
You're using an old version of clang-format binary. Please update to a more recent one by running: './mach bootstrap'
would be better to have
You're using an old version (8.0.1) of clang-format binary. Please update to a more recent (at least > 9.0.1 one by running: './mach bootstrap'

The code is declared twice:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#212
and
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#1550

we should refactor that to have it once

Expected version is found here:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#905
and the detected:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#918

Happy to mentor someone!

Blocks: 1588285

Hi Sylvestre,

I would like to work on this issue.

Kind Regards
Sonia

Sure, just submit a patch :)

Flags: needinfo?(sledru)

Sonia, not sure why you need-info me ?!
I don't see any patch here :)

Flags: needinfo?(sledru)

Hello Sylvestre,
Is it possible I work on this issue? I am a new contributor and came by this issue. I like to ask that are patches equivalent to commits to the version control server which in this case is Mercurial? In addition, is it better to discuss on this thread or on IRC like mibbit?

Sincerely,
Peter Chou

Hi Peter,

I am already working on this patch. You can pick any other issue from the bug list. And, #media is the IRC channel where you can ask your questions. It depends on the time-zone of yours and mentor if they are being active around that time or not.

Welcome to the Mozilla Community :)

Kind Regards
Sonia

Alright. Thanks for informing me Sonia.

Sonia, please let me know when the patch is ready.
thanks

Flags: needinfo?(soniasingla.1812)

Expected version is found here:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#905
and the detected:
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#918

I didn't get about the version part. This is little unclear to me. Can you please explain little bit?

Flags: needinfo?(soniasingla.1812)

Could you explain what is unclear? Thanks

And, #media is the IRC channel where you can ask your questions. It depends on the time-zone of yours and mentor if they are being active around that time or not.

Note that #media is primarily concerned with Mozilla's media stack and other channels may be able to better answer questions that aren't media related. There's currently an outreachy project proposed around media, which makes it a good port of first call if you're interested in that project, but that for bugs like this one other channels (like #build) may be able to offer more specific help.

I didn't get about the version part. This is little unclear to me. Can you please explain little bit?

I believe these lines get the desired version of the clang tidy that we want to use, based on configuration files.

These lines then run the installed version of clang-format (which should have the same version as clang-tidy, as they're installed as a pair) and compare the version string it outputs to the one we expect. If it matches we return true, if it doesn't match, or if we can't run clang-format then we return false.

Does that help?

Assignee: nobody → soniasingla.1812

To improve the version comparison, it is required to be more explicit while using old-version of clang-format.

Sonia, are you still working on this or should I unassign this bug?
Thanks

Flags: needinfo?(soniasingla.1812)

Hi Sylvestre,

Am sorry for the delay. If it's urgent you can unassign the bug, no worries :)

Flags: needinfo?(soniasingla.1812)

it isn't urgent but if you don't have time, we can find someone else :)

Assignee: soniasingla.1812 → nobody
Assignee: nobody → soniasingla.1812
Status: NEW → ASSIGNED

Unassigned as no progress for the last 5 months

Assignee: soniasingla.1812 → nobody
Status: ASSIGNED → NEW
Attachment #9105860 - Attachment is obsolete: true

Hi Sylvestre
I am a new contributor. I would like to work on this issue.

sure, please go ahead and try to submit a patch :)

Assignee: nobody → harnaman24
Status: NEW → ASSIGNED
Attachment #9168976 - Attachment description: Bug 1588185 - modified clang-format version error info. r=sylvestre → Bug 1588185 - Show an error when an old/incorrect version of clang-format is used r=sylvestre
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/493302af24e6 Show an error when an old/incorrect version of clang-format is used r=sylvestre
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

Today with clang trunk I got ERROR: You're using an old or incorrect version (clang-format version 12.0.0) of clang-format binary. Please update to a more recent one (at least > 11.0.0) by running: './mach bootstrap' which is kind of awkward. Should newer versions be accepted? Or should the messaging change?

This is why we wrote "or incorrect" but, for sure, the "more recent one" is misleading.

The issue with having different versions of clang-format is that it generates different output.
If you want to play with 12, update package_version in tools/clang-tidy/config.yaml

We could update the message if you want :)

Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: